package com.aaa.java09;

/**
 * @author ：Teacher陈（86521760@qq.com）
 * @date ：Created in 2022/7/12 14:34
 * @description：我的宠物类
 * @modified By：
 * @version: 1.0
 */
public abstract class MyPet {
    private String name;
    private  int age;
    private String color;

    public MyPet() {
    }

    public MyPet(String name, int age, String color) {
        this.name = name;
        this.age = age;
        this.color = color;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public abstract void playWithOwner();

    /**
     * @create by: Teacher陈（86521760@qq.com）
     * @description: 抽象方法，标识此行为在子类中必须重写，不重写，报错，或者变成抽象类
     * @create time: 2022/7/12 16:11
     */
    public abstract   void eat();

    @Override
    public String toString() {
        return "MyPet{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", color='" + color + '\'' +
                '}';
    }

    public static void main(String[] args) {

    }
}
